﻿using System;
using System.Runtime.Serialization;

namespace Dimok.Shared.Filtering {
  [DataContract]
  public class FilterQuery {
    [DataMember]
    public FilterOperator Operator { get; set; }
    [DataMember]
    public string[] Values { get; set; }
    [DataMember]
    public string Query { get; set; }
    [DataMember]
    public string ValueTypeName { get; set; }
    public FilterQuery() { }
    public FilterQuery(string Query, FilterOperator Operator, string[] Values, Type ValueType) {
      this.Query = Query;
      this.Operator = Operator;
      this.Values = Values;
      this.ValueTypeName = ValueType.FullName;
    }
  }
  [DataContract]
  public enum FilterOperator {
    NoFilter = 0,
    IsEmpty,
    IsNotEmpty,
    IsNull,
    IsNotNull,
    IsLessThan,
    IsLessThanOrEqualTo,
    IsEqualTo,
    IsNotEqualTo,
    IsGreaterThanOrEqualTo,
    IsGreaterThan,
    StartsWith,
    EndsWith,
    Contains,
    DoesNotContain,
    IsContainedIn,
    IsBetween,
    IsNotBetween
  }
}
